package com.wingsboat.common.filterChain.filter;

import com.wingsboat.common.filterChain.chain.WbFilterChain;
import com.wingsboat.common.filterChain.context.WbFilterContext;

/**
 * @Author: wangzhong
 * @Date: 2023/11/16 20:58
 * @Description:
 **/

public abstract class AbstractWbFilter<T extends WbFilterContext> implements WbFilter<T> {

    @Override
    public void doFilter(T context, WbFilterChain<T> chain) {
        handle(context);
        if(context.isContinue()){
            chain.handler(context);
        }
    }

    protected abstract void handle(T context);
}
